<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <script type="module">
      // eslint-disable-next-line unicorn/import-index
      import { renderer } from './index.js';

      const vnode = {
        tag: 'div',
        props: {
          onClick: () => alert('hello'),
        },
        children: 'click me',
      };

      const MyComponent = function () {
        return {
          tag: 'div',
          props: {
            onClick: () => alert('hello'),
          },
          children: 'click me',
        };
      };

      const ObjComponent = function () {
        return {
          tag: 'div',
          props: {
            onClick: () => alert('hello'),
          },
          children: 'click me',
        };
      };

      const FuComponentVnode = {
        tag: MyComponent,
      };

      const ObjectComponentVnode = {
        tag: ObjComponent,
      };

      renderer(ObjectComponentVnode, document.querySelector('#app'));
    </script>
  </body>
</html>
